<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  

  
  <title>gitee发布hexo博客具体方法 | 姚根深的博客</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="安装软件及管理工具1234567npm install hexohexo initmkdir hexocd hexohexo installnpm install --save hexo-deployer-gitnpm install --save hexo-admin  基础配置信息12345678910111213141516# Sitetitle: 姚根深的博客subtitle: &amp;#x27">
<meta property="og:type" content="article">
<meta property="og:title" content="gitee发布hexo博客具体方法">
<meta property="og:url" content="https://cnwik.gitee.io/blog/2021/10/02/hello-world/index.html">
<meta property="og:site_name" content="姚根深的博客">
<meta property="og:description" content="安装软件及管理工具1234567npm install hexohexo initmkdir hexocd hexohexo installnpm install --save hexo-deployer-gitnpm install --save hexo-admin  基础配置信息12345678910111213141516# Sitetitle: 姚根深的博客subtitle: &amp;#x27">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-10-02T02:05:45.000Z">
<meta property="article:modified_time" content="2021-10-02T02:35:26.059Z">
<meta property="article:author" content="姚根深">
<meta property="article:tag" content="JAVA javascript vue react css html js blog 博客 姚根深 程序员 职业 职场 考试 疑难 问题 参考">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/blog/atom.xml" title="姚根深的博客" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  
<link rel="stylesheet" href="/blog/css/style.css">

<meta name="generator" content="Hexo 5.4.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/blog/" id="logo">姚根深的博客</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/blog/">Home</a>
        
          <a class="main-nav-link" href="/blog/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/blog/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="搜索"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="https://cnwik.gitee.io/blog"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-hello-world" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/blog/2021/10/02/hello-world/" class="article-date">
  <time datetime="2021-10-02T02:05:45.000Z" itemprop="datePublished">2021-10-02</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      gitee发布hexo博客具体方法
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h3 id="安装软件及管理工具"><a href="#安装软件及管理工具" class="headerlink" title="安装软件及管理工具"></a>安装软件及管理工具</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo</span><br><span class="line">hexo init</span><br><span class="line">mkdir hexo</span><br><span class="line"><span class="built_in">cd</span> hexo</span><br><span class="line">hexo install</span><br><span class="line">npm install --save hexo-deployer-git</span><br><span class="line">npm install --save hexo-admin</span><br></pre></td></tr></table></figure>

<h3 id="基础配置信息"><a href="#基础配置信息" class="headerlink" title="基础配置信息"></a>基础配置信息</h3><figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Site</span></span><br><span class="line"><span class="attr">title:</span> <span class="string">姚根深的博客</span></span><br><span class="line"><span class="attr">subtitle:</span> <span class="string">&#x27;&#x27;</span></span><br><span class="line"><span class="attr">description:</span> <span class="string">&#x27;JAVA javascript vue react css html js blog 博客 姚根深&#x27;</span></span><br><span class="line"><span class="attr">keywords:</span>  <span class="string">&#x27;JAVA javascript vue react css html js blog 博客 姚根深 程序员 职业 职场 考试 疑难 问题 参考&#x27;</span></span><br><span class="line"><span class="attr">author:</span> <span class="string">姚根深</span></span><br><span class="line"><span class="attr">language:</span> <span class="string">zh-CN</span></span><br><span class="line"><span class="attr">timezone:</span> <span class="string">&#x27;Asia/Shanghai&#x27;</span></span><br><span class="line"><span class="attr">deploy:</span></span><br><span class="line">  <span class="attr">type:</span> <span class="string">git</span></span><br><span class="line">  <span class="attr">repo:</span> <span class="string">git@gitee.com:cnwik/blog.git</span></span><br><span class="line">  <span class="attr">branch:</span> <span class="string">master</span></span><br><span class="line"><span class="comment"># URL</span></span><br><span class="line"><span class="comment">## Set your site url here. For example, if you use GitHub Page, set url as &#x27;https://username.github.io/project&#x27;</span></span><br><span class="line"><span class="attr">url:</span>  <span class="string">https://cnwik.gitee.io/blog</span></span><br><span class="line"><span class="attr">root:</span> <span class="string">/blog</span></span><br></pre></td></tr></table></figure>

<h3 id="hexo操作"><a href="#hexo操作" class="headerlink" title="hexo操作"></a>hexo操作</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo g //本地发布</span><br><span class="line">hexo d //发布到gitee</span><br><span class="line">hexo s //启动服务</span><br></pre></td></tr></table></figure>

<h3 id="预览及管理界面"><a href="#预览及管理界面" class="headerlink" title="预览及管理界面"></a>预览及管理界面</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">http://localhost:4000/blog/</span><br><span class="line">http://localhost:4000/blog/admin/</span><br></pre></td></tr></table></figure>

<h3 id="文件及样式修改"><a href="#文件及样式修改" class="headerlink" title="文件及样式修改"></a>文件及样式修改</h3><p>根据需要进行主题的样式修改<br>\hexo\themes\landscape\layout_partial\after-footer.ejs</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;script src=<span class="string">&quot;//code.jquery.com/jquery-2.0.3.min.js&quot;</span>&gt;&lt;/script&gt;</span><br></pre></td></tr></table></figure>
<p>\hexo\themes\landscape\source\css_variables.styl</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">// Header</span><br><span class="line">logo-size = 16px</span><br><span class="line">subtitle-size = 14px</span><br><span class="line">banner-height = 100px</span><br></pre></td></tr></table></figure>
<p>\hexo\themes\landscape\source\css_partial\footer.styl</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-id">#footer</span></span><br><span class="line">  <span class="attribute">background</span>: color-footer-background</span><br><span class="line">  padding: <span class="number">20px</span> <span class="number">0</span></span><br></pre></td></tr></table></figure>
<h3 id="一键三连"><a href="#一键三连" class="headerlink" title="一键三连"></a>一键三连</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo clean &amp;&amp; hexo g &amp;&amp; hexo d</span><br></pre></td></tr></table></figure>
<p>提交到gitee资源后，需要登录gitee pages服务中去发布或更新。</p>
<h3 id="小结"><a href="#小结" class="headerlink" title="小结"></a>小结</h3><p>在处理过程中遇到几个问题说明一下：<br>gitee配置需要申请ssh访问，在仓库中添加自己的SSH密钥即可；<br>出现js/css资源无法访问请修改配置中的url及root信息，jquery.min.js文件需更换地址；<br>如果配置文件中没有的信息请自行添加。  </p>
<p>gitee发布hexo博客具体方法 姚根深 2021.10.02</p>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://cnwik.gitee.io/blog/2021/10/02/hello-world/" data-id="ckugbr0kv0001foil5lu1clxl" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/blog/2021/10/07/mysql8-0%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          mysql8.0安装配置
        
      </div>
    </a>
  
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    

  
    
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">归档</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2021/10/">十月 2021</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">最新文章</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/blog/2021/10/07/git%E4%BD%BF%E7%94%A8%E5%8F%82%E8%80%83/">git使用参考</a>
          </li>
        
          <li>
            <a href="/blog/2021/10/07/mysql8-0%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/">mysql8.0安装配置</a>
          </li>
        
          <li>
            <a href="/blog/2021/10/02/hello-world/">gitee发布hexo博客具体方法</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2021 姚根深<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/blog/" class="mobile-nav-link">Home</a>
  
    <a href="/blog/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//code.jquery.com/jquery-2.0.3.min.js"></script>


  
<link rel="stylesheet" href="/blog/fancybox/jquery.fancybox.css">

  
<script src="/blog/fancybox/jquery.fancybox.pack.js"></script>




<script src="/blog/js/script.js"></script>




  </div>
</body>
</html>